<?php
session_start();
$login_arr = array();
require_once 'inc/config.inc.php';

if (isset ($_GET['isLogin'])) {
	header("LOCATION:../college/mplat/index.php");
} else {
	if (isset ($_GET['op']) && isset ($_GET['uin']) && isset ($_GET['session'])) {
		$op = trim($_GET['op']);
		$uin = trim($_GET['uin']);
		$sessionkey = trim($_GET['session']);
	} else {
		header("LOCATION:../error_docs/index.html");
	}
	require_once (CONN_PATH);
	require_once ('library/core.class.php');
	$core = new core($db_core);
	$login_arr = $core->session_login($uin, $sessionkey);
	if ($login_arr['chk_uin'] == $uin) {
		$_SESSION['account_arr'] = $login_arr;
		if ($op == 'setIcon') {
			header("LOCATION:../college/mplat/roominfo.php");
		}
		elseif ($op == 'moneyChange') {
			header("LOCATION:../college/mplat/gift_manage.php");
		}
		elseif ($op == 'updateRoom') {
			header("LOCATION:../college/mplat/index.php");
		}
		elseif ($op == 'requestCompetiton') {
			header("LOCATION:../college/mplat/index.php");
		}
		elseif ($op == 'passProtect') {
			header("LOCATION:../college/mplat/passprotect.php");
		}elseif ($op == 'putAdvertisement') {
			header("LOCATION:../college/mplat/buyMsgAds.php?module=buyAds");
		}
	} else {
		header("LOCATION:../college/mplat/index.php");
	}
}
close_conn($db_core);
?>